<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="sculove.spring.framework.util.AuthUtil"%>
<html>
<head>
<title>로그인</title>
<%@ include file="/WEB-INF/view/common/Header.jspf" %>
<script type="text/javascript">
<%
	if(AuthUtil.hasSession(request)) {%>		
		top.location.href="/zzz.login.htm";
<%
	}
%>

	$(document).ready( function() {
        // 1. 입력폼 유효성 체크  
        $("#form_login").validate({ 
			// submit 버튼 눌러졌을때
        	submitHandler: function(form) {
        		//alert( $("#form_frameworkTokenForm > input[name='REQUEST_TOKEN']").val());
        		//$(form).append("<input type='hidden' name='REQUEST_TOKEN' value='" + $("#form_frameworkTokenForm > input[name='REQUEST_TOKEN']").val() + "'/>"); 
           		form.action="/zzz.login.htm";
           		form.submit(); 
           	},
           	// validataion 실패일 경우.
	        invalidHandler: function(form, validator) {
			    var errors = validator.numberOfInvalids();
				alert("submit fail : " + form + " , errors : " + errors);
            }
            // 에러적용 규칙
            //rules: {
              //  userId: {
                	//digits : true
               // },
               // password: {
               // 	//digits : true
               // }
            //},
        });          
	});
</script>
</head>
<body>
<form:form id="form_login" commandName="UserDTO" method="post">
	<table>
		<tr>
			<td>Login</td>
			<td>
			<select name="language">
				<option value="KOR">한글</option>
				<option value="ENG">영문</option>
			</select>
			</td>
		</tr>
		<tr>
			<td><label class="required_tit" for="userId">ID</label></td>
			<td><input class="required" type="text" name="userId"/></td>
		</tr>
		<tr>
			<td><label class="required_tit" for="password">PASSWORD</label></td>
			<td><input class="required" type="password" name="password" /></td>
		</tr>
		<tr>
			<td><input type="submit" id="testsubmit" value="로그인"></td>
			<td><label id="summary"></td>
		</tr>
	</table>
</form:form>
<%@ include file="/WEB-INF/view/common/Footer.jspf" %>
</body>
</html>